package com.youlei.newgraduateproject.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlei.newgraduateproject.dao.EmployeesMapper;
import com.youlei.newgraduateproject.dynamic.datasource.annotation.DataSource;
import com.youlei.newgraduateproject.entity.Employees;
import com.youlei.newgraduateproject.entity.Employees2;
import com.youlei.newgraduateproject.service.EmployeesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author youlei
 * @since 2021-05-08
 */
@Service
public class EmployeesServiceImpl extends ServiceImpl<EmployeesMapper, Employees> implements EmployeesService {

    @Resource
    EmployeesMapper employeesMapper;

    @Override
    @DataSource("slave1")
    public Employees2 getByEmployeeId(Integer id) {
        return employeesMapper.getByEmployeeId(id);
    }
}
